package org.dreamwork.tools.code.analyzer.core.data;

import org.dreamwork.persistence.*;
import org.dreamwork.tools.code.analyzer.core.model.EntityType;

@ISchema (org.dreamwork.tools.code.analyzer.core.data.schema.EntitySchema.class)
public class Entity {
	@ISchemaField (name = "_id", id = true)
	private String id;

	@ISchemaField (name = "_name")
	private String name;

	@ISchemaField (name = "_belongs_to")
	private String belongsTo;

	@ISchemaField (name = "_type")
	private EntityType type;

	@ISchemaField (name = "_path")
	private String path;

	@ISchemaField (name = "_ignored")
	private String ignored;

	@ISchemaField (name = "_created")
	private String created;

	public String getId () {
		return id;
	}

	public void setId (String id) {
		this.id = id;
	}

	public String getName () {
		return name;
	}

	public void setName (String name) {
		this.name = name;
	}

	public String getBelongsTo () {
		return belongsTo;
	}

	public void setBelongsTo (String belongsTo) {
		this.belongsTo = belongsTo;
	}

	public EntityType getType () {
		return type;
	}

	public void setType (EntityType type) {
		this.type = type;
	}

	public String getPath () {
		return path;
	}

	public void setPath (String path) {
		this.path = path;
	}

	public String getIgnored () {
		return ignored;
	}

	public void setIgnored (String ignored) {
		this.ignored = ignored;
	}

	public String getCreated () {
		return created;
	}

	public void setCreated (String created) {
		this.created = created;
	}

	@Override
	public boolean equals (java.lang.Object o) {
		if (this == o) return true;
		if (o == null || getClass () != o.getClass ()) return false;
		Entity that = (Entity) o;
		return id != null && id.equals (that.id);
	}

	@Override
	public int hashCode () {
		return String.valueOf (id).hashCode ();
	}
}